package com.ycyoes.test.hollis.concurrent.thread.alive;

public class ThreadAlive {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            System.out.println("t1 begin");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }
            System.out.println("t1 end");
        });
        t1.start();
        System.out.println("t1.isAlive()="+t1.isAlive());
        System.out.println("-------------join start------------");
        t1.join();
        System.out.println("-------------join end------------");
        System.out.println("t1.isAlive()="+t1.isAlive());
    }
}
